#@adminLayout()
#define main()
<div class="jbolt_page" data-key="#(pmkey)"  >
    <div class="jbolt_page_title">
        <div class="row">
            <div class="col-4">
                <h1>商家类别管理</h1>
                <span> #(pageData.totalRow?? 0) 条记录</span>
            </div>
            <div class="col-5">
                <form class="form-inline" id="memberFormIndex" action="/auth/mall/retailer/type"  data-pjaxsubmit  method="get">
                    <input type="text" autocomplete="off"  class="form-control"  placeholder="输入关键字搜索" id="keywords" name="keywords" value="#(keywords??)" />
                    <input type="hidden" name="isDelete" value="#(isDelete?? false)"/>
                    <button  type="button" onclick="normaMemberlData()" class="btn btn-light" ><i class="fa fa-search"></i> 查询</button>
                    <!--<button  onclick="Testreset()" class="btn btn-light"  ><i class="fa fa-refresh"></i> 重置</button>-->
                    <button  type="button" onclick="trashMemberData()" class="btn btn-#((isDelete?? && isDelete=='true')?'danger':'light')" ><i class="fa fa-trash"></i> 回收站(#(deleteCount?? 0))</button>
                </form>
            </div>

            <div class="col-3">
                <button data-area="800,500" data-handler="refreshPjaxContainer"   data-jboltlayertrigger  data-width="500"       data-noclose  data-confirm   data-title="新增" data-url="/auth/mall/retailer/type/add" class="pull-right jbolt_table_addbtn btn btn-success" ><i class="fa fa-plus"></i> 新增</button>
            </div>

        </div>
    </div>
    <div class="jbolt_page_content">
        <div class="table-responsive">
            <table class="table table-bordered table-hover table-striped table-center">
                <thead>
                <tr>
                    <th style="width: 60px">序号</th><th style="width: 100px">商家类别</th>
                    <th style="width: 100px">图片</th><th style="width: 100px">备注</th>
                    <th  style="width: 160px">创建时间</th>
                    <th  style="width: 160px">分类排序</th>
                    <th  style="width: 160px">是否首页推荐</th>
                    <th style="width: 60px">操作</th>
                </tr>
                </thead>
                <tbody>
                #if(pageData)
                #for(data:pageData.list)
                <tr>
                    <td>#(for.index+1)</td>
                    <td>#(data.name??)</td>
                    <td><img class="j_goodslist_mainimg" data-photobtn tooltip data-title="点击查看大图"  src="#realImage(data.image??,'/assets/img/uploadimg.png')"/></td>
                    <td>#(data.memo??)</td>
                    <td>#(data.create_time??)</td>
                    <td>#(data.displayorder??)</td>
                    <td><img src="#(data.isrecommand?'/assets/img/switch/default/on.png':'/assets/img/switch/default/off.png')" data-switchbtn data-confirm="是否切换首页资格?"   data-url="/auth/mall/retailer/type/toggle_isrecommand/#(data.id)"/></td>
                    <td>
                        #if(data.is_del??)
                        <a  tooltip  title="还原"  href="/auth/mall/retailer/type/delete_restore_retailer_type/#(data.id)" data-handler="refreshPjaxContainer" data-confirm="确定恢复此商家类型？(恢复后的商家类型移出回收站)" class="jbolt_table_delbtn"><i class="fa fa-mail-reply c-danger"></i></a>
                        #else
                        <a  tooltip  title="编辑"  class="jbolt_table_delbtn" data-confirm  data-jboltlayertrigger  href="/auth/mall/retailer/type/modify/#(data.id)" class="btn btn-info"   data-width="500"  data-noclose><i class="fa fa-pencil c-primary"></i></a>
                        <a  tooltip  title="删除"  href="/auth/mall/retailer/type/delete_restore_retailer_type/#(data.id)" data-handler="refreshPjaxContainer" data-confirm="确定删除此商家类型？(删除后的商家类型进入回收站)" class="jbolt_table_delbtn"><i class="fa fa-remove c-danger"></i></a>
                        #end
                    </td>
                </tr>
                #end
                #end
                </tbody>
            </table>
        </div>
        #include("/_view/_admin/common/_page.html",pageEleId="memberPageIndex")
    </div>
</div>
</div>
</div>
#end
#define js()
<script type="text/javascript">

    var memberFormIndex=$("#memberFormIndex");

    $(function(){
        initPage("memberPageIndex",#(pageData.totalPage??),#(pageData.pageNumber??),"memberFormIndex");
    });


    /**
     * 普通查询
     */
    function normaMemberlData(){
        memberFormIndex.find("[name='isDelete']").val(false);
        memberFormIndex.submit();
    }

    /**
     * 查回收站
     */
    function trashMemberData(){
        memberFormIndex.find("[name='isDelete']").val(true);
        memberFormIndex.submit();
    }

    //测试可刷新 -- 提交表单
    function RefreshsubmitForm(formEId){
        var form=getRealJqueryObject(formEId);
        if(FormChecker.check(form)){
            // LayerMsgBox.loading("执行中...");
            // var formData=form.serialize();
            var url=form.action;
            form.ajaxSubmit({
                type:"post",
                url:url,
                success:function(ret){
                    if(ret.state=="ok"){
                        LayerMsgBox.success(ret.msg,500,function(){
                            refreshPjaxContainer();
                        });
                    }else{
                        LayerMsgBox.alert(ret.msg,2);
                    }
                }
            });
        }
        return false;
    }

</script>



#end

